package br.com.forwardsms;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

import br.com.forwardsms.load.LoadMessage;
import android.app.Activity;
import android.content.res.Resources;
import android.content.res.Resources.NotFoundException;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class ForwardSmsActivity extends Activity {
	
	Button btnSendSMS;
	Button btnLoadMsg;
	private String phone;
	private String titlle;
	private String text;
	
	private ForwardSmsActivity getInstancce(){
		return this;
	}

	public void setPhone(String phone) {
		this.phone = phone;
		android.widget.TextView tv = (TextView) findViewById(R.id.editTextPhone);
		tv.setText(this.phone);
	}

	public void setTitlle(String titlle) {
		this.titlle = titlle;
		android.widget.TextView tv = (TextView) findViewById(R.id.editTextTitlle);
		tv.setText(this.titlle);
	}

	public void setText(String text) {
		this.text = text;
		android.widget.TextView tv = (TextView) findViewById(R.id.editTextText);
		tv.setText(this.text);
	}

	/** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        btnSendSMS = (Button) findViewById(R.id.sendbutton);
        btnSendSMS.setOnClickListener(new View.OnClickListener() 
        {
            public void onClick(View v) 
            {                
                /*String phoneNo = txtPhoneNo.getText().toString();
                String message = txtMessage.getText().toString();                 
                if (phoneNo.length()>0 && message.length()>0)                
                    sendSMS(phoneNo, message);                
                else
                    Toast.makeText(getBaseContext(), 
                        "Please enter both phone number and message.", 
                        Toast.LENGTH_SHORT).show();*/
            	setContentView(R.layout.choosedevice);
            }
        });
        
        btnLoadMsg = (Button) findViewById(R.id.loadbutton);
        btnLoadMsg.setOnClickListener(new View.OnClickListener() 
        {
            public void onClick(View v) 
            {       
            	LoadMessage load = new LoadMessage(getInstancce());
            	load.displayMessage();
            }
        });
    }

	@Override
	protected void onResume() {
		// TODO Auto-generated method stub
		super.onResume();
		
	}
    
}